//
//  UIViewContoller+Extension.swift
//  SBNewProject
//
//  Created by hlt on 2023/9/22.
//

import UIKit

//extension UIViewController{
//    private static var AGE_KEY:Void?
//    var age:Int{
//        get{
//            objc_getAssociatedObject(self, &Self.AGE_KEY) as? Int ?? 0
//        }
//        
//        set{
//            objc_setAssociatedObject(self, &Self.AGE_KEY, newValue, .OBJC_ASSOCIATION_ASSIGN)
//        }
//        
// }
//    
    
    
    
    
//}


//extension UIView{
//    //当前显示的控制器
//    static func visibleViewController() -> UIViewController?{
//        let rootController = UIApplication.shared.delegate!.window!?.rootViewController
//        let visiblevc =  rootController?.visibleViewControllerIfExist()
//        return visiblevc
//    }
//    
////    private func visibleViewControllerIfExist(_ vc:UIViewController) -> UIViewController?{
////        if(vc.presentedViewController != nil){
////            return vc.presentedViewController?.visibleViewControllerIfExist(vc:)
////        }
////        if(vc.isKind(of: UINavigationController.self)){
////            let nabarvc = self as! UINavigationController
////            
////            return nabarvc.topViewController?.visibleViewControllerIfExist()
////        }
////        
////        if(self.isKind(of: UITabBarController.self)){
////            let tabarvc = self as! UITabBarController
////            return tabarvc.selectedViewController?.visibleViewControllerIfExist()
////        }
////        
////        if(self.isViewLoaded == true && self.view.isHidden == false && self.view.alpha > 0.01){
////            return self;
////        }else{
////            return nil
////        }
////    }
//}




extension UIViewController{

 
    
  
    
}
